<template>
  <div class="Showcase1">
    <div class="shadow-box">
      <div class="shadow-top">
        <div
          class="shadow-top-left"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase1dy1.webp'})`,
          }"
        ></div>
        <div class="shadow-top-center"></div>
        <div
          class="shadow-top-right"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase1dy2.webp'})`,
          }"
        ></div>
      </div>
      <div class="shadow-bottom">
        <img class="shadow-left" :src="publicUrls + 'free/style7/Showcase1dy3.webp'" alt="" />
        <div
          class="shadow-center"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style7/Showcase1dy4.webp'})`,
          }"
        ></div>

        <img class="shadow-right" :src="publicUrls + 'free/style7/Showcase1dy5.webp'" alt="" />
      </div>
    </div>
    <div class="Showcase1-top">
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style7/Showcase1bg1.webp'"
        alt=""
      />
      <div
        class="Showcase1-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase1bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style7/Showcase1bg3.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-center">
      <div
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase1bg10.webp'})`,
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.7638)}rem`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
      >
        <p class="name-box">
          {{ item.name }}
        </p>
      </div>

      <div
        class="Showcase1-center-left"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase1bg4.webp'})`,
        }"
      ></div>
      <div class="Showcase1-center-center"></div>
      <div
        class="Showcase1-center-right"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase1bg6.webp'})`,
        }"
      ></div>
    </div>
    <div class="Showcase1-bottom">
      <img
        class="Showcase1-bottom-left"
        :src="publicUrls + 'free/style7/Showcase1bg7.webp'"
        alt=""
      />
      <div
        class="Showcase1-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Showcase1bg8.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-bottom-right"
        :src="publicUrls + 'free/style7/Showcase1bg9.webp'"
        alt=""
      />
    </div>
    <!-- Showcase1Topleft -->
  </div>
</template>   

<script lang="ts">
export default defineComponent({
  name: 'style1',
});
</script>
  
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
// 1.30
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.3;
};
</script>   

<style scoped lang="less">
.Showcase1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 150px;
  min-width: 286px;
  // -webkit-box-reflect: below 0% linear-gradient(transparent, rgba(0, 0, 0, 0.2));
}
.Showcase1-top {
  display: flex;
  width: 100%;
  height: 60px;
}
.Showcase1-top-left {
  width: 93px;
  height: 60px;
}
.Showcase1-top-center {
  flex: 1;
  height: 60px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-top-right {
  width: 93px;
  height: 60px;
}
.Showcase1-center {
  position: relative;
  display: flex;
  width: 100%;
  // flex: 1;
  height: calc(100% - 120px);
}
.ex-item {  
  display: flex;
  justify-content: center; 
  // align-items: center;  
  position: absolute;  
  top: -10px;    
  width: 254px;  
  height: 63px;  
  background-repeat: repeat;  
  background-size: 100% 100%;
  padding: 9px 19px;  
} 
.name-box {   
  margin-top: 12px;
  width: 100%;
  font-family: SourceMedium;
  font-size: 18px;
  line-height: 32.4px;
  color: rgba(51, 51, 51, 1);
  overflow: hidden; 
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.Showcase1-center-left {
  width: 93px;
  height: 100%;
  background-size: 94px auto;
  background-repeat: repeat;
}
.Showcase1-center-center {
  position: relative;
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase1-center-right {
  width: 93px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase1-bottom {
  display: flex;
  width: 100%;
  height: 60px;
}
.Showcase1-bottom-left {
  width: 93px;
  height: 60px;
}
.Showcase1-bottom-center {
  flex: 1;
  height: 60px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-bottom-right {
  width: 93px;
  height: 60px;
}
.shadow-box { 
  display: flex;
  flex-direction: column; 
  position: absolute;  
  top: calc(100% - 60px);
  left: 0;   
  z-index: -1;    

  width: 100%;  
  height: calc(100% ); 
  min-height: 150px; 
}
.shadow-top {
  position: relative;
  display: flex;
  width: 100%;
  // flex: 1;
  height: calc(100% - 60px);
  position: relative;
  display: flex;
  width: 100%;
  // flex: 1;
}
.shadow-top-left {
  width: 93px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.shadow-top-center {
  flex: 1;
  height: 100%;
}
.shadow-top-right {
  width: 93px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.shadow-bottom {
  display: flex;
  width: 100%;
  height: 60px;
}
.shadow-left {
  width: 93px;
  height: 60px;
}
.shadow-center {
  flex: 1;
  height: 60px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-right {
  width: 93px;
  height: 60px;
}
</style>